//
//  ST_PrivateChatTipsCell.swift
//  btvideo
//
//  Created by mac on 2020/12/21.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit
import SwifterSwift
import SwiftyAttributes
import SnapKit

class ST_PrivateChatTipsCell: UITableViewCell {

    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.selectionStyle = .none
        self.contentView.backgroundColor = Color.clear
        
        contentView.addSubview(tips_text_root_view)
        tips_text_root_view.snp.makeConstraints { (make) in
            make.edges.equalToSuperview().inset(UIEdgeInsets.init(top: 10, left: 15, bottom: 0, right: 15))
        }
        
        tips_text_root_view.addSubview(tips_text_label)
        tips_text_label.snp.makeConstraints { (make) in
            make.top.left.equalToSuperview().offset(10)
            make.right.equalToSuperview().offset(-15)
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    var message:ST_DTChatMessage! {
        didSet{
            
            tips_text_label.attributedText = message.chatText.withAttributes([Attribute.font(Font.systemFont(ofSize: 13, weight: UIFont.Weight.regular)),Attribute.textColor(UIColor.init(hex: 0xFEC207)!),Attribute.paragraphStyle(NSParagraphStyle.create_line_spacing_paragraph_style(lineSpacing: 3))])
            
        }
    }
    
    fileprivate lazy var tips_text_root_view:UIView = {
        
        let control = UIView()
        control.cornerRadius = 15
        control.backgroundColor = UIColor.init(hex: 0xF5F8FA)
        return control
    }()
    
    fileprivate lazy var tips_text_label:UILabel = {
        
        let control = UILabel()
        control.numberOfLines = 0
        return control
    }()
}
